package com.sunyard.manage.service;

import com.sunyard.dal.bo.role.RolePopedomConfigBO;
import com.sunyard.dal.bo.role.RolePopedomQueryBO;
import com.sunyard.dal.dto.PopedomAddReqDTO;
import com.sunyard.dal.entity.Popedom;
import com.sunyard.dal.entity.RoleCopy;
import com.sunyard.utils.Response.BaseResult;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 *  * @Description:权限接口，用来操作权限
 *  * @author:zhangbo
 *  * @date:2017年7月17日 上午9:48:51
 *  
 */
public interface PopedomService {

    /**
     * @Description: 根据用户Id查找其对应的权限
     * @Author: jiy.fang
     * @Date: 2019/7/25 14:14
     */
    List<Popedom> findByUserId(String opId);

    /**
     * @Description: 查询登录用户所属机构拥有权限
     * @Author: jiy.fang
     * @Date: 2019/7/26 9:22
     */
    BaseResult findPopedomTreeByOpId(HttpServletRequest request, String orgId, String orgPid) throws Exception;

    /**
     * @Description: 角色权限分配
     * @Author: jiy.fang
     * @Date: 2019/7/27 9:14
     */
    BaseResult configRolePopedom(HttpServletRequest request, RolePopedomConfigBO rolePopedomConfigBO, RoleCopy roleCopy) throws Exception;

    /**
     * @Description: 查询角色可分配的权限
     * @Author: jiy.fang
     * @Date: 2019/7/29 10:25
     */
    BaseResult findRolePopedomTreeByOpId(HttpServletRequest request, RolePopedomQueryBO queryBO) throws Exception;

    /**
     * @Description: 查询待分配角色已经拥有的权限
     * @Author: jiy.fang
     * @Date: 2019/8/5 15:31
     */
    BaseResult findRoleOwnPopedomTreeByRoleId(String roleId) throws Exception;

    /**
     * @description TODO
     * @author tsz
     * @date 2022/12/16
     * @param url
     * @return int 
     * @throws 
    */
    int findPopedomByUrl(String url);

    /**
     * @description 添加权限
     * @author tsz
     * @date 2022/12/16
     * @param addReqDTO
     * @return BaseResult 
     * @throws 
    */
    BaseResult addPopedom(PopedomAddReqDTO addReqDTO);

    /**
     * @Description: 角色权限添加
     * @Author: chengy.wei
     * @Date: 2022/06/30
     */
    BaseResult addRolePopedom(HttpServletRequest request, RolePopedomConfigBO rolePopedomConfigBO) throws Exception;

    /**
     * @description 查询所有权限
     * @author tsz
     * @date 2022/12/16
     * @param
     * @return BaseResult
     * @throws
    */
    BaseResult findAllpopedom();

}
